﻿<UserControl x:Class="YALV.View.Components.FilterPanel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="200" d:DesignWidth="300"

            xmlns:cult="clr-namespace:YalvLib.ViewModel;assembly=YALVLib"
            xmlns:Properties="clr-namespace:YalvLib.Strings;assembly=YALVLib"
             >

  <Grid VerticalAlignment="Top" HorizontalAlignment="Stretch">
    <Grid.Resources>
      <Style x:Key="tbCountStyle" TargetType="TextBlock">
        <Setter Property="Margin" Value="0,3,0,0" />
        <Setter Property="FontSize" Value="11" />
        <Setter Property="TextAlignment" Value="Center" />
        <Setter Property="ToolTip" Value="{x:Static Properties:Resources.MainWindow_SelectionTooltip}" />
        <Setter Property="VerticalAlignment" Value="Center" />
      </Style>
    </Grid.Resources>

    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="Auto"/>
      <ColumnDefinition Width="Auto"/>
      <ColumnDefinition Width="Auto"/>
      <ColumnDefinition Width="Auto"/>
      <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>

    <!-- ALL -->
    <RadioButton IsChecked="{Binding Path=YalvLogViewModel.LogEntryRows.SelectAll}"
                 VerticalAlignment="Center" HorizontalAlignment="Stretch" Grid.Column="1" Grid.Row="0" Margin="3">
    </RadioButton>
    <TextBlock Text="All" Grid.Column="2" Grid.Row="0" />

    <TextBlock Style="{StaticResource tbCountStyle}" Grid.Column="3" Grid.Row="0" Margin="3" VerticalAlignment="Center" HorizontalAlignment="Left">
      <TextBlock.Text>
        <MultiBinding StringFormat="{}{0,10}">
          <Binding Mode="OneWay" Path="YalvLogViewModel.LogEntryRows.LogView.Count" FallbackValue="0"/>
        </MultiBinding>
      </TextBlock.Text>
    </TextBlock>

    <!-- DEBUG -->
    <Border Background="{StaticResource DebugLevelColor}" Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="1" Padding="3" />

    <CheckBox IsChecked="{Binding Path=YalvLogViewModel.LogEntryRows.ShowLevelDebug}" Name="chkShowDebug" ToolTip="DEBUG"
                             Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,3,3,3" />

    <RadioButton IsChecked="{Binding Path=YalvLogViewModel.LogEntryRows.SelectDebug}"
                 HorizontalAlignment="Stretch"  Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" Margin="3">
    </RadioButton>
    <TextBlock Text="Debug" Foreground="Black" Grid.Column="2" Grid.Row="1" />

    <TextBlock Style="{StaticResource tbCountStyle}" Grid.Column="3" Margin="3" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left">
      <TextBlock.Text>
        <MultiBinding StringFormat="{}{0,10}">
          <Binding Mode="OneWay" Path="YalvLogViewModel.LogEntryRows.ItemsDebugCount" FallbackValue="0" />
        </MultiBinding>
      </TextBlock.Text>
    </TextBlock>

    <!-- INFO -->
    <Border Background="{StaticResource InfoLevelColor}" Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="2" Padding="3" />

    <CheckBox IsChecked="{Binding Path=YalvLogViewModel.LogEntryRows.ShowLevelInfo}"
                  Name="chkShowInfo" ToolTip="INFO"
                  Grid.Column="0" Grid.Row="2"
                  HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,3,3,3"/>

    <RadioButton IsChecked="{Binding Path=YalvLogViewModel.LogEntryRows.SelectInfo}"
                 VerticalAlignment="Center" HorizontalAlignment="Stretch" Grid.Column="1" Grid.Row="2" Margin="3">
    </RadioButton>
    <TextBlock Text="Info" Foreground="Black" Grid.Column="2" Grid.Row="2" />

    <TextBlock Style="{StaticResource tbCountStyle}" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="3" Grid.Row="2" Margin="3">
      <TextBlock.Text>
        <MultiBinding StringFormat="{}{0,10}">
          <Binding Mode="OneWay" Path="YalvLogViewModel.LogEntryRows.ItemsInfoCount" FallbackValue="0" />
        </MultiBinding>
      </TextBlock.Text>
    </TextBlock>

    <!-- WARN -->
    <Border Background="{StaticResource WarnLevelColor}" Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="3" Padding="3" />

    <CheckBox IsChecked="{Binding Path=YalvLogViewModel.LogEntryRows.ShowLevelWarn}"
                  Name="chkShowWarn" ToolTip="WARN"
                  Grid.Column="0" Grid.Row="3"
                  HorizontalAlignment="Right" VerticalAlignment="Center" Margin="3" />

    <RadioButton IsChecked="{Binding Path=YalvLogViewModel.LogEntryRows.SelectWarn}"
                 VerticalAlignment="Center" HorizontalAlignment="Stretch" Grid.Column="1" Grid.Row="3"  Margin="3">
    </RadioButton>
    <TextBlock Text="Warn" Foreground="Black" Grid.Column="2" Grid.Row="3" />

    <TextBlock Style="{StaticResource tbCountStyle}" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="3" Grid.Row="3" Margin="3">
      <TextBlock.Text>
        <MultiBinding StringFormat="{}{0,10}">
          <Binding Mode="OneWay" Path="YalvLogViewModel.LogEntryRows.ItemsWarnCount" FallbackValue="0" />
        </MultiBinding>
      </TextBlock.Text>
    </TextBlock>

    <!-- ERROR -->
    <Border Background="{StaticResource ErrorLevelColor}" Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="4" Padding="3" />

    <CheckBox IsChecked="{Binding Path=YalvLogViewModel.LogEntryRows.ShowLevelError}"
                  Name="chkShowError" ToolTip="ERROR"
                  Grid.Column="0" Grid.Row="4"
                  HorizontalAlignment="Right" VerticalAlignment="Center" Margin="3"/>

    <RadioButton IsChecked="{Binding Path=YalvLogViewModel.LogEntryRows.SelectError}"
                 VerticalAlignment="Center" HorizontalAlignment="Stretch" Grid.Column="1" Grid.Row="4" Margin="3">
    </RadioButton>
    <TextBlock Text="Error" Foreground="Black" Grid.Column="2" Grid.Row="4" />

    <TextBlock Style="{StaticResource tbCountStyle}" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="3" Grid.Row="4" Margin="3">
      <TextBlock.Text>
        <MultiBinding StringFormat="{}{0,10}">
          <Binding Mode="OneWay" Path="YalvLogViewModel.LogEntryRows.ItemsErrorCount" FallbackValue="0" />
        </MultiBinding>
      </TextBlock.Text>
    </TextBlock>

    <!-- FATAL -->
    <Border Background="{StaticResource FatalLevelColor}" Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="5" Padding="3" />

    <CheckBox IsChecked="{Binding Path=YalvLogViewModel.LogEntryRows.ShowLevelFatal}"
                  Name="chkShowFatal" ToolTip="FATAL"
                  Grid.Column="0" Grid.Row="5"
                  HorizontalAlignment="Right" VerticalAlignment="Center" Margin="3"/>
    <RadioButton IsChecked="{Binding Path=YalvLogViewModel.LogEntryRows.SelectFatal}"
                 VerticalAlignment="Center" HorizontalAlignment="Stretch" Grid.Column="1" Grid.Row="5" Margin="3">
    </RadioButton>
    <TextBlock Text="Fatal" Foreground="Black" Grid.Column="2" Grid.Row="5" />

    <TextBlock Style="{StaticResource tbCountStyle}" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="3" Grid.Row="5" Margin="3">
      <TextBlock.Text>
        <MultiBinding StringFormat="{}{0,10}">
          <Binding Mode="OneWay" Path="YalvLogViewModel.LogEntryRows.ItemsFatalCount" FallbackValue="0" />
        </MultiBinding>
      </TextBlock.Text>
    </TextBlock>

    <TextBlock Text="Sum"
               HorizontalAlignment="Right"
               Grid.Column="2" Grid.Row="6"/>

    <TextBlock Style="{StaticResource tbCountStyle}" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="3" Grid.Row="6" Margin="3">
      <TextBlock.Text>
        <MultiBinding StringFormat="{}{0,10}">
          <Binding Mode="OneWay" Path="YalvLogViewModel.LogEntryRows.LogView.Count" FallbackValue="0" />
        </MultiBinding>
      </TextBlock.Text>
    </TextBlock>

  </Grid>

</UserControl>
